#ifndef _IOBUF_H_
#define _IOBUF_H_

#define IO_BUF_SIZE 0x400

typedef struct __iobuf {
  int buf[IO_BUF_SIZE];
  int front;
  int back;
  int size;
} iobuf;

void IobufInit(iobuf *ib);

int IobufEmpty(iobuf *ib);

int IobufFull(iobuf *ib);

int IobufSize(iobuf *ib);

int IobufEnqueue(iobuf *ib, int i);

int IobufDequeue(iobuf *ib, int* out);

#endif
